/******************************************************************************
  Grog Engine sample app - v0.1 - (c)2007 Naicigam
  ------------------------------------------------
  Filename: DirectInput.h
  Creation date: 13/08/2007
  Author: Juan Manuel Alvarez
 ******************************************************************************/

//------------------------------------------------------------------------------
#ifndef DX_INPUT_H
#define DX_INPUT_H
//------------------------------------------------------------------------------
#define DIRECTINPUT_VERSION 0x0800
//------------------------------------------------------------------------------
#include <dinput.h>
#include <windows.h>

#include "system/System.h"
#include "Input.h"
//------------------------------------------------------------------------------
#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dxguid.lib")
//------------------------------------------------------------------------------
namespace leo
{
//------------------------------------------------------------------------------
class LEO_API DirectInput : public Input
{
	//////////////////////////////////////////////////////
	// TO-DO: DirectInput has to be a singleton!!!!
	//////////////////////////////////////////////////////

private:

	// DirectInput stuff
	LPDIRECTINPUT8 KeyboardObj;
	LPDIRECTINPUT8 MouseObj;

	LPDIRECTINPUTDEVICE8 KeyboardDev;
	LPDIRECTINPUTDEVICE8 MouseDev;

	DIMOUSESTATE    MouseState;
	HINSTANCE		AppInstance;
	HWND			WindowHandler;

public:

	// constuctor
	DirectInput(HINSTANCE kInstance, HWND kWnd);

	virtual ~DirectInput();

	// overloaded from Input
	bool Init();
	void Update();
	void Deinit();
	void Reset();
	void Acquire();
	void Reacquire();
	void Unacquire();
};
//------------------------------------------------------------------------------
} // end namespace
//------------------------------------------------------------------------------
#endif //_DX_INPUT_H_
//------------------------------------------------------------------------------